package com.hw.one.dam2.dao;

import java.util.List;
import java.util.Map;

import com.hw.one.dam2.po.PatrolDevicePO;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;


public class PatrolDeviceDao extends SqlSessionDaoSupport implements IPatrolDeviceDao {

	@Override
	public List<Map<String, Object>> findPatrolDeviceInfoByRegionCode(Map<String,Object> paraMap) throws Exception {
		return getSqlSession().getMapper(IPatrolDeviceDao.class).findPatrolDeviceInfoByRegionCode(paraMap);
	}

	@Override
	public void insertPatrolDeviceSelective(PatrolDevicePO patrolDevicePO) {
		getSqlSession().getMapper(IPatrolDeviceDao.class).insertPatrolDeviceSelective(patrolDevicePO);
	}

	@Override
	public List<Map<String, Object>> findPatrolDeviceInfoByDeviceCode(String deviceCode) {
		return getSqlSession().getMapper(IPatrolDeviceDao.class).findPatrolDeviceInfoByDeviceCode(deviceCode);
	}

	/**
	 * 根据所属区域编码和设备类型，获取巡检设备信息
	 * 
	 * @param paraMap{regionCode:区域编码；deviceType
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<Map<String,Object>> findDeviceNumByRegionCodeAndType(Map<String,Object> paraMap) throws Exception{
		return getSqlSession().getMapper(IPatrolDeviceDao.class).findDeviceNumByRegionCodeAndType(paraMap);
	}

}
